<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">   
<?php
include_once('db.php'); 

    $empresa = $_POST['empresa_b'];

    $sql ="select a.*, b.nombre  from quincena_calculo a join empresa b on a.id_empresa = b.id_empresa where a.id_empresa = $empresa order by a.id_corte desc limit 1";
    $result = mysql_query($sql);
    while ($row = mysql_fetch_array($result)) {    
       $corte = $row[id_corte]; 
       $numero_empresa = $row[id_empresa];
       $nom_empresa = $row[nombre];
       $fecha = $row[fecha];
       $total = $row[total];
       $cantidad_pagada = $row[cantidad_pagada];
       $cantidad_restante = $row[cantidad_restante];
       $intereses_generados = $row[intereses_generados];
       $cantidad_a_favor = $row[cantidad_a_favor];
       $pagada = $row[pagada];
    }

?>
<html >
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Saade: Captura de facturas de clientes</title>
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <link rel="stylesheet" type="text/css" href="css/form.css" />  
        <link rel="stylesheet" href="css/example.css" TYPE="text/css" MEDIA="screen">
        <script type="text/javascript" src="js/bsn.AutoSuggest_c_2.0.js"></script>
        <script src="js/jquery-1.2.6.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="js/tabber.js"></script>
        <script type="text/javascript">

            /* Optional: Temporarily hide the "tabber" class so it does not "flash"
            on the page as plain HTML. After tabber runs, the class is changed
            to "tabberlive" and it will appear. */

            document.write('<style type="text/css">.tabber{display:none;}<\/style>');
        </script>
        <script>
            function cerrar()
            {
                parent.$.fancybox.close();
            }
        </script>
        <script type="text/javascript" src="js/jquery.tools.min.js"></script>

    </head>
    <body style="margin: 0px; padding: 0px;" >
        <div class="header_fancy">
            <div class="cerrar_fancy" onclick="cerrar();"></div> 
            <p style="margin-left: 23px; padding-top: 20px; margin-top:0px">ESTATUS DE EMPRESA</p>

        </div>

        <table id="forma">
            <tr>
                <td>       
                    <div id="forma_ingredientes">
                        <form action="estatus_empresa_procesa.php" enctype="multipart/form-data" method="POST" name="ingrediente" id="ingrediente">
                            <table align="center">
                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Corte:</div></td>
                                    <td ><input type="text" autocomplete="off"  readonly style="background-color:#ccc;" class="idle_fancy" align="LEFT" size="20" value="<?php echo $corte ?>" name="corte" /></td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Empresa:</div></td>
                                    <td >
                                    <input type="text" autocomplete="off"  readonly style="background-color:#ccc;" class="idle_fancy" align="LEFT" size="50" value="<?php echo $nom_empresa ?>" name="empresa" />
                                    <input type="hidden" name="empresa_numerico" value="<?php echo $empresa_b; ?>">
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Fecha:</div></td>
                                    <td ><input type="text" autocomplete="off"  readonly style="background-color:#ccc;" class="idle_fancy" align="LEFT" size="20" name="fecha" value="<?php echo $fecha ?>" /></td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Total:</div></td>
                                    <td ><input type="text" autocomplete="off"  readonly style="background-color:#ccc;" class="idle_fancy" align="LEFT" size="20" name="total" value="<?php echo $total ?>" /></td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Cantidad pagada:</div></td>
                                    <td ><input type="text" autocomplete="off" readonly  style="background-color:#ccc;" class="idle_fancy" align="LEFT" size="20" name="pagada" value="<?php echo $cantidad_pagada ?>"  required="required" /></td>
                                </tr>

                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Cantidad restante:</div></td>
                                    <td ><input type="text" autocomplete="off" readonly style="background-color:#ccc;" class="idle_fancy" align="LEFT" size="20" name="restante" value="<?php echo $cantidad_restante ?>" /></td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Intereses generados:</div></td>
                                    <td ><input type="text" autocomplete="off" class="idle_fancy" align="LEFT" size="20" name="intereses"  value="<?php echo $intereses_generados ?>" required="required" /></td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-right: 15px;"><div class="input_fancy">Cantidad a favor:</div></td>
                                    <td ><input type="text" autocomplete="off" readonly style="background-color:#ccc;" class="idle_fancy" align="LEFT" size="20" name="a_favor" value="<?php echo $cantidad_a_favor ?>"  /></td>
                                </tr>
                              
                            </table>
                            <input type="hidden" name="id_empresa" value="<?php echo $numero_empresa ?>"> 
                             <br><span style="margin-left: 450px;"></span><input type="image" src="img/todo/BOTON_GUARDAR_CAMBIOS.png" >
                        </form>
                        <br>
                    </div> 

                </td>
            </tr>
        </table>
        <script>
            $("#ingrediente").validator();
        </script>
    </body>
</html>